/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.gov.ana.entities;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author lucas.nunes
 */
@Entity
@Table(name = "QLTTB_STATUS_EXCECAO_MEDICAO")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "StatusExcecaoMedicao.findAll", query = "SELECT s FROM StatusExcecaoMedicao s"),
    @NamedQuery(name = "StatusExcecaoMedicao.findBySemId", query = "SELECT s FROM StatusExcecaoMedicao s WHERE s.semId = :semId"),
    @NamedQuery(name = "StatusExcecaoMedicao.findBySemNm", query = "SELECT s FROM StatusExcecaoMedicao s WHERE s.semNm = :semNm"),
    @NamedQuery(name = "StatusExcecaoMedicao.findBySemDs", query = "SELECT s FROM StatusExcecaoMedicao s WHERE s.semDs = :semDs"),
    @NamedQuery(name = "StatusExcecaoMedicao.findBySemDsSimbolo", query = "SELECT s FROM StatusExcecaoMedicao s WHERE s.semDsSimbolo = :semDsSimbolo"),
    @NamedQuery(name = "StatusExcecaoMedicao.findBySemVhmId", query = "SELECT s FROM StatusExcecaoMedicao s WHERE s.semVhmId = :semVhmId")})
public class StatusExcecaoMedicao implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "SEM_ID")
    private BigDecimal semId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 104)
    @Column(name = "SEM_NM")
    private String semNm;
    @Size(max = 4000)
    @Column(name = "SEM_DS")
    private String semDs;
    @Size(max = 5)
    @Column(name = "SEM_DS_SIMBOLO")
    private String semDsSimbolo;
    @Column(name = "SEM_VHM_ID")
    private BigInteger semVhmId;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "mdhSemId")
    private List<MedHidrometeorologica> medHidrometeorologicaList;

    public StatusExcecaoMedicao() {
    }

    public StatusExcecaoMedicao(BigDecimal semId) {
        this.semId = semId;
    }

    public StatusExcecaoMedicao(BigDecimal semId, String semNm) {
        this.semId = semId;
        this.semNm = semNm;
    }

    public BigDecimal getSemId() {
        return semId;
    }

    public void setSemId(BigDecimal semId) {
        this.semId = semId;
    }

    public String getSemNm() {
        return semNm;
    }

    public void setSemNm(String semNm) {
        this.semNm = semNm;
    }

    public String getSemDs() {
        return semDs;
    }

    public void setSemDs(String semDs) {
        this.semDs = semDs;
    }

    public String getSemDsSimbolo() {
        return semDsSimbolo;
    }

    public void setSemDsSimbolo(String semDsSimbolo) {
        this.semDsSimbolo = semDsSimbolo;
    }

    public BigInteger getSemVhmId() {
        return semVhmId;
    }

    public void setSemVhmId(BigInteger semVhmId) {
        this.semVhmId = semVhmId;
    }

    @XmlTransient
    public List<MedHidrometeorologica> getMedHidrometeorologicaList() {
        return medHidrometeorologicaList;
    }

    public void setMedHidrometeorologicaList(List<MedHidrometeorologica> medHidrometeorologicaList) {
        this.medHidrometeorologicaList = medHidrometeorologicaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (semId != null ? semId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof StatusExcecaoMedicao)) {
            return false;
        }
        StatusExcecaoMedicao other = (StatusExcecaoMedicao) object;
        if ((this.semId == null && other.semId != null) || (this.semId != null && !this.semId.equals(other.semId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.gov.ana.service.StatusExcecaoMedicao[ semId=" + semId + " ]";
    }
    
}
